import backtrader as bt


class SmaCross(bt.SignalStrategy):
    def __init__(self, param):
        sma1 = bt.ind.SMA(period=param['periodFast'])
        sma2 = bt.ind.SMA(period=param['periodSlow'])
        self.crossover = bt.ind.CrossOver(sma1, sma2)
        self.signal_add(bt.SIGNAL_LONG, self.crossover)

    def next(self):
        print(self.crossover[0])
        pass
    @staticmethod
    def getParamList():
        return [
            {'periodFast': 5, 'periodSlow': 10},
            {'periodFast': 5, 'periodSlow': 15},
            {'periodFast': 5, 'periodSlow': 20},
            {'periodFast': 5, 'periodSlow': 25},
            {'periodFast': 5, 'periodSlow': 30},

            {'periodFast': 10, 'periodSlow': 30},
            {'periodFast': 10, 'periodSlow': 40},
            {'periodFast': 10, 'periodSlow': 50},

            {'periodFast': 20, 'periodSlow': 60},
            {'periodFast': 20, 'periodSlow': 80},
            {'periodFast': 20, 'periodSlow': 100},
        ]
